//
//  SelectTableCell.m
//  ebook
//
//  Created by 吴超飞 on 16/5/25.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import "SelectTableCell.h"

@implementation SelectTableCell{
    UIImageView *rightIV;
    UILabel *InfoLabel;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        rightIV = [[UIImageView alloc]init];
        InfoLabel = [[UILabel alloc]init];
        InfoLabel.backgroundColor = [UIColor clearColor];
        InfoLabel.textColor = MTConfigColor(@"MTSelectTableCell_infoLabelBg_Color");
        InfoLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:rightIV];
        [self.contentView addSubview:InfoLabel];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    InfoLabel.frame = CGRectMake(20, 0, self.width - 20 - 40, self.height);
    rightIV.frame = CGRectMake(self.frame.size.width-40, (self.frame.size.height-20)/2, 20, 20);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    rightIV.image = [UIImage imageNamed:selected ? @"radios":@"radion"];
}

-(void)setLabelText:(NSString *)text{
    InfoLabel.text = text;
}


@end
